INCLUDE_DIRECTORIES (../)
INCLUDE_DIRECTORIES (./)

ADD_EXECUTABLE(
        EWAUIWidgetTest

        Main.cpp

        EWAUIWindowDockerSpace.hpp
        EWAUIWindowDockerSpace.cpp

        EWAUIWidgetTest1.hpp
        EWAUIWidgetTest1.cpp
)

TARGET_LINK_LIBRARIES (EWAUIWidgetTest EWAUIWidget)
TARGET_LINK_LIBRARIES (EWAUIWidgetTest EWAUI)

TARGET_LINK_LIBRARIES (EWAUIWidgetTest EyerMath)
TARGET_LINK_LIBRARIES (EWAUIWidgetTest EyerCore)
TARGET_LINK_LIBRARIES (EWAUIWidgetTest EyerThread)
TARGET_LINK_LIBRARIES (EWAUIWidgetTest EyerGLAD)

TARGET_LINK_LIBRARIES (EWAUIWidgetTest gtest)
TARGET_LINK_LIBRARIES (EWAUIWidgetTest imgui)
TARGET_LINK_LIBRARIES (EWAUIWidgetTest glfw3)

TARGET_LINK_LIBRARIES (EWAUIWidgetTest avformat)
TARGET_LINK_LIBRARIES (EWAUIWidgetTest avcodec)
TARGET_LINK_LIBRARIES (EWAUIWidgetTest swscale)
TARGET_LINK_LIBRARIES (EWAUIWidgetTest swresample)
TARGET_LINK_LIBRARIES (EWAUIWidgetTest avutil)

TARGET_LINK_LIBRARIES (EWAUIWidgetTest freetype)
TARGET_LINK_LIBRARIES (EWAUIWidgetTest x264)
TARGET_LINK_LIBRARIES (EWAUIWidgetTest png)
TARGET_LINK_LIBRARIES (EWAUIWidgetTest z)
TARGET_LINK_LIBRARIES (EWAUIWidgetTest bz2)
TARGET_LINK_LIBRARIES (EWAUIWidgetTest lzma)
TARGET_LINK_LIBRARIES (EWAUIWidgetTest mp3lame)
TARGET_LINK_LIBRARIES (EWAUIWidgetTest jsoncpp)

IF (CMAKE_SYSTEM_NAME MATCHES "Linux")
    MESSAGE(STATUS "current platform: Linux ")
    TARGET_LINK_LIBRARIES (EWAUIWidgetTest X11)
ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Windows")
    MESSAGE(STATUS "current platform: Windows")
    ADD_DEFINITIONS(-D EYER_PLATFORM_WINDOWS)
    TARGET_LINK_LIBRARIES (EWAUIWidgetTest ws2_32)
    TARGET_LINK_LIBRARIES (EWAUIWidgetTest Secur32)
    TARGET_LINK_LIBRARIES (EWAUIWidgetTest imm32)
    TARGET_LINK_LIBRARIES (EWAUIWidgetTest Mfplat)
    TARGET_LINK_LIBRARIES (EWAUIWidgetTest Bcrypt)
    TARGET_LINK_LIBRARIES (EWAUIWidgetTest Strmiids)
ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Android")
    MESSAGE(STATUS "current platform: Android")
    ADD_DEFINITIONS(-D EYER_PLATFORM_ANDROID)
ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
    MESSAGE(STATUS "current platform: Darwin")
    ADD_DEFINITIONS(-D EYER_PLATFORM_DARWIN)
    TARGET_LINK_LIBRARIES (EWAUIWidgetTest iconv)
ELSE ()
    MESSAGE(STATUS "other platform: ${CMAKE_SYSTEM_NAME}")
ENDIF (CMAKE_SYSTEM_NAME MATCHES "Linux")

INSTALL(
        TARGETS EWAUIWidgetTest
        RUNTIME DESTINATION bin
        LIBRARY DESTINATION lib
        ARCHIVE DESTINATION lib
)